# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=ukui-power-manager
pkgver=3.0.1
pkgrel=2
pkgdesc="Power management tool for the UKUI desktop"
arch=('loong64' 'x86_64')
license=('GPL')
url="https://github.com/ukui/ukui-power-manager"
groups=('ukui')
depends=('dbus-glib' 'gtk3' 'libgnome-keyring' 'libnotify' 'upower'
         'libcanberra')
makedepends=('intltool' 'mate-common' 'yelp-tools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ukui/ukui-power-manager/archive/v$pkgver.tar.gz")
sha512sums=('0b7be755c7f16e5c5534c2630cb77340fb1d0387a9207004c74b0ff241adecfd80ccc06167913f9dd6b6d22f62032af4eb40f5d4682d2eb403f517f29cb9e0d3')

prepare() {
  cd $pkgname-$pkgver
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --libexecdir=/usr/lib/$pkgname --sbindir=/usr/bin --sysconfdir=/etc
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install dbusdir=/usr/share/dbus-1/system.d systemddir=/usr/lib/systemd/system
}
